package com.example.course.controller.admin;

import com.example.course.dto.admin.*;
import com.example.course.service.ScoresService;
import com.example.course.utils.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/scores")
public class AdminScoresController {

    @Autowired
    private ScoresService scoresService;

    @PostMapping("/save_scores")
    public Result saveScores(@RequestBody AdminScoresSaveDto dto){
        return scoresService.saveScores(dto);
    }

    @PostMapping("/remove_scores")
    public Result removeScores(@RequestBody AdminScoresRemoveDto dto){
        return scoresService.removeScores(dto);
    }

    @PostMapping("/update_get_scores")
    public Result updateGetScores(@RequestBody AdminScoresUpdateGetDto dto){
        return scoresService.updateGetScores(dto);
    }

    @PostMapping("/update_scores")
    public Result updateScores(@RequestBody AdminScoresUpdateDto dto){
        return scoresService.updateScores(dto);
    }

    @PostMapping("/get_scores_list")
    public Result getAdminScores(@RequestBody AdminScoresListDto dto){
        return scoresService.getAdminScores(dto);
    }

}
